package com.yc.thread.pro1_matrix.single;

import java.util.Random;

/**
 * @author zwei
 * @create 2024-07-16 15:08
 */
public class MatrixGenerator {
    /**
     * 矩阵生成器        生成一个二维矩阵
     * @param rows
     * @param cols
     * @return
     */
    public static double[][] generate(int rows,int cols){
        double[][] ret=new double[rows][cols];
        Random r=new Random();
        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < cols; j++) {
                ret[i][j]=r.nextDouble()*10;
            }
        }
        return ret;
    }
}
